﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demos.DesignPatterns._07_适配器模式
{

    /// <summary>
    /// 支付宝支付
    /// </summary>
    public class AlipayService
    {
        public bool AlipayTransfer(string account, decimal amount)
        {
            Console.WriteLine($"支付宝支付：向{account}支付 {amount}元");
            return new Random().Next(100) > 10; // 模拟90%成功率
        }

        public string CheckAlipayTransaction(string transactionId)
        {
            return new Random().Next(100) > 10 ? "支付成功" : "支付失败";
        }
    }

}
